package com.fz.song.service;

import com.fz.song.mapper.BigFileMapper;
import com.fz.song.pojo.BigFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class BigFileServiceImpl implements BigFileService {

    @Autowired
    private BigFileMapper bigFileMapper;


    @Override
    public BigFile getFileByMd5(String md5) {
        if (StringUtils.isEmpty(md5)) {
            return null;
        }
        BigFile file = bigFileMapper.getFileByMd5(md5);
        return file;
    }

    @Override
    public Boolean save(BigFile bigFile) {
        return bigFileMapper.insertSelective(bigFile) == 1 ? true : false;
    }
}
